package com.ruoyi.system.api.factory;

import com.ruoyi.system.api.RemoteWarehouseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @author sss
 * @description 智能仓储服务降级
 * @date 2022/7/27
 */
public class RemoteWarehouseFallbackFactory implements FallbackFactory<RemoteWarehouseService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteWarehouseFallbackFactory.class);

    @Override
    public RemoteWarehouseService create(Throwable throwable) {

        log.error("调用智能仓储服务失败:{}", throwable.getMessage());

        return new RemoteWarehouseService() {
            @Override
            public void updateAssetAsync(String orgNo) {

            }
        };
    }
}
